Upgrading SDN software by dual-loading modules

ABSTRACT

Some embodiments of the invention provide a method of upgrading software defined networking (SDN) modules executing on a host computer. While a first version of the SDN modules is executing on the host computer to perform traffic processing, the method loads a second version of the SDN modules alongside the first version of the SDN modules such that the first and second versions of the SDN modules are executing on the host computer at the same time. The method saves runtime states from the first version of the SDN modules, and transfers responsibility for performing traffic processing from the first version of the SDN modules to the second version of the SDN modules. The method then restores the saved runtime states to the second version of the SDN modules.

BACKGROUND

Today, network virtualization is rapidly growing due to the flexibilityof use and quick realization of user requirements, and has led to a boomin large scale software-defined datacenters. The methods of upgradingsoftware defined network (SDN) software on a host currently tend to fallinto one of two categories. Maintenance mode-based upgrades require aredundant host to house the VMs during the upgrade, while live upgradesinvolve several steps that contribute to long downtimes. Due to thetypically massive scale of the datacenters, which can include hundredsof hosts/servers that each host hundreds of virtual machines (VMs), thedowntimes experienced due to necessary upgrades have become increasinglylonger and more concerning.

BRIEF SUMMARY

Some embodiments of the invention provide a method for upgradingsoftware defined networking (SDN) modules executing on a host computer(e.g., in virtualization software of the host computer). The SDNmodules, in some embodiments, include datapath modules (e.g., virtualswitches, virtual routers, firewall and other service modules, etc.)and/or control plane modules (e.g., bidirectional forwarding detection(BFD) modules, controller modules, etc.). While a first version of theSDN modules is executing on the host computer to perform trafficprocessing, a second version of the SDN modules is loaded alongside thefirst version of the SDN modules such that the first and second versionsof the SDN modules are executing on the host computer at the same time.The method of some embodiments saves the runtime states from the firstversion of the SDN modules, transfers responsibility for performingtraffic processing from the first version of the SDN modules to thesecond version of the SDN modules, and restores the saved runtime statesto the second version of the SDN modules. In some embodiments, themethod then upgrades the firewall module on a port-by-port basis foreach port associated with a machine executing on the host computer forwhich the firewall module processes traffic. In some embodiments, someor all of these operations are performed by a runtime migrator (RTM)module that is loaded prior to the loading of the second version of theSDN modules and unloaded once all of the SDN modules are upgraded.

The first version of the SDN modules is an existing version of the SDNmodules while the second version of the SDN modules is an upgradedversion of the SDN modules, according to some embodiments. In order todistinguish between the existing and updated versions of the SDNmodules, such as for the namespaces that the modules depend on, someembodiments add a bill number (i.e., a bill number of the software) tothe SDN modules. In some embodiments, the bill numbers are also used tosend information that is specific to either the existing or upgradedmodules (e.g., event information relating to the upgrade process). Forexample, the RTM module in some embodiments uses the bill numbers tosend messages to only the existing modules to prepare the modules forthe upgrade process.

In some embodiments, the RTM module saves the runtime states from thefirst version of the SDN modules differently for different modules. Forinstance, for a virtual router module, in some embodiments a controlplane stores runtime state (e.g., routing tables for various virtualrouters executing on the host computer). The RTM module initiates asynchronization process in which the virtual router module retrieves allof this state from the control plane, which is then stopped while thevirtual router module is updated.

The transfer of responsibility from the first version of the SDN modulesto the second version of the SDN modules can also be different fordifferent modules in some embodiments. For instance, the virtual switchmodule of some embodiments is associated with numerous distributedvirtual switches executing on the host that process traffic fordifferent portsets (groups of ports that are connected by a singlevirtual switch). The RTM module disassociates property data (e.g., MACaddress to port mappings) of the virtual switch from the old virtualswitch module, directly swaps the virtual switch from the old virtualswitch module to the new virtual switch module, and associates theproperty data with the new module. This operation is performedseparately for each virtual switch (e.g., while transferringresponsibility to the new modules on a portset-by-portset basis).

As mentioned above, the firewall module is the last module of the SDNmodules to be upgraded in some embodiments. Once all of the portsetshave been moved to the new version of the other SDN modules,responsibility for handling firewall processing is moved to the newversion of the firewall module on a port-by-port basis. For each portassociated with a machine executing on the host computer for which thefirewall module processes traffic to and from the port, the RTM moduleblocks the port to prevent traffic from flowing to or from the port,saves a runtime state of the first version of the firewall module thatrelates to the port, transfers association of a firewall filterassociated with the port from the first version of the firewall moduleto the second version of the firewall module, restores the saved runtimestate for the port to the second version of the firewall module, andthen unblocks that port.

In some embodiments, in the time period between when the firewall modulehas been upgraded for a first port and when the firewall module has beenupgraded for the last port, at least one port is serviced by the firstversion of the firewall module and at least one other port (at sometimes in the same portset) is serviced by the second version of thefirewall module. Once the firewall module has been upgraded on all ofthe ports, in some embodiments, the first version of the firewall moduleand the first version of the other SDN modules are unloaded.

The preceding Summary is intended to serve as a brief introduction tosome embodiments of the invention. It is not meant to be an introductionor overview of all inventive subject matter disclosed in this document.The Detailed Description that follows and the Drawings that are referredto in the Detailed Description will further describe the embodimentsdescribed in the Summary as well as other embodiments. Accordingly, tounderstand all the embodiments described by this document, a full reviewof the Summary, the Detailed Description, the Drawings, and the Claimsis needed. Moreover, the claimed subject matters are not to be limitedby the illustrative details in the Summary, the Detailed Description,and the Drawings.

BRIEF DESCRIPTION OF FIGURES

The novel features of the invention are set forth in the appendedclaims. However, for purposes of explanation, several embodiments of theinvention are set forth in the following figures.

FIG. 1 illustrates a process performed by an RTM module in someembodiments to upgrade SDN modules executing on a host computer.

FIG. 2 conceptually illustrates an example set of SDN modules that areupgraded in the process described in FIG. 1 , in some embodiments.

FIG. 3 conceptually illustrates a set of stages that provide a visualrepresentation of the dual-loading and upgrading of the SDN modules asdescribed in the process of FIG. 1 , in some embodiments.

FIG. 4 illustrates a process performed by a virtual router in someembodiments as part of the upgrading process.

FIG. 5 illustrates communications between a virtual router and a controlplane as part of the upgrade process, in some embodiments

FIG. 6 conceptually illustrates the actions of the RTM module to restorethe saved runtime states without having to rely on the control plane,according to some embodiments.

FIG. 7 illustrates a process performed in some embodiments by the RTMmodule to upgrade the virtual switch.

FIG. 8 illustrates a diagram representing the process described in FIG.7 , according to some embodiments.

FIG. 9 illustrates a host computer on which an RTM module is loaded toupgrade the SDN modules, including the firewall module, in someembodiments.

FIG. 10 illustrates a process performed by the RTM module to upgrade thefirewall module in some embodiments.

FIG. 11 conceptually illustrates a set of stages as the firewall moduleis upgraded for a portset, in some embodiments.

FIG. 12 conceptually illustrates a computer system with which someembodiments of the invention are implemented.

DETAILED DESCRIPTION

In the following detailed description of the invention, numerousdetails, examples, and embodiments of the invention are set forth anddescribed. However, it will be clear and apparent to one skilled in theart that the invention is not limited to the embodiments set forth andthat the invention may be practiced without some of the specific detailsand examples discussed.

Some embodiments of the invention provide a method for upgradingsoftware defined networking (SDN) modules executing on a host computer(e.g., in virtualization software of the host computer). The SDNmodules, in some embodiments, include datapath modules (e.g., virtualswitches, virtual routers, firewall and other service modules, etc.)and/or control plane modules (e.g., bidirectional forwarding detection(BFD) modules, controller modules, etc.). While a first version of theSDN modules is executing on the host computer to perform trafficprocessing, a second version of the SDN modules is loaded alongside thefirst version of the SDN modules such that the first and second versionsof the SDN modules are executing on the host computer at the same time.The method of some embodiments saves the runtime states from the firstversion of the SDN modules, transfers responsibility for performingtraffic processing from the first version of the SDN modules to thesecond version of the SDN modules, and restores the saved runtime statesto the second version of the SDN modules. In some embodiments, themethod then upgrades the firewall module on a port-by-port basis foreach port associated with a machine executing on the host computer forwhich the firewall module processes traffic. In some embodiments, someor all of these operations are performed by a runtime migrator (RTM)module that is loaded prior to the loading of the second version of theSDN modules and unloaded once all of the SDN modules are upgraded.

The first version of the SDN modules is an existing version of the SDNmodules while the second version of the SDN modules is an upgradedversion of the SDN modules, according to some embodiments. In order todistinguish between the existing and updated versions of the SDNmodules, such as for the namespaces that the modules depend on, someembodiments add a bill number (i.e., a bill number of the software) tothe SDN modules. In some embodiments, the bill numbers are also used tosend information that is specific to either the existing or upgradedmodules (e.g., event information relating to the upgrade process). Forexample, the RTM module in some embodiments uses the bill numbers tosend messages to only the existing modules to prepare the modules forthe upgrade process.

In some embodiments, the RTM module saves the runtime states from thefirst version of the SDN modules differently for different modules. Forinstance, for a virtual router module, in some embodiments a controlplane stores runtime state (e.g., routing tables for various virtualrouters executing on the host computer). The RTM module initiates asynchronization process in which the virtual router module retrieves allof this state from the control plane, which is then stopped while thevirtual router module is updated.

The transfer of responsibility from the first version of the SDN modulesto the second version of the SDN modules can also be different fordifferent modules in some embodiments. For instance, the virtual switchmodule of some embodiments is associated with numerous distributedvirtual switches executing on the host that process traffic fordifferent portsets (groups of ports that are connected by a singlevirtual switch). The RTM module disassociates property data (e.g., MACaddress to port mappings) of the virtual switch from the old virtualswitch module, directly swaps the virtual switch from the old virtualswitch module to the new virtual switch module, and associates theproperty data with the new module. This operation is performedseparately for each virtual switch (e.g., while transferringresponsibility to the new modules on a portset-by-portset basis).

As mentioned above, the firewall module is the last module of the SDNmodules to be upgraded in some embodiments. Once all of the portsetshave been moved to the new version of the other SDN modules,responsibility for handling firewall processing is moved to the newversion of the firewall module on a port-by-port basis. For each portassociated with a machine executing on the host computer for which thefirewall module processes traffic to and from the port, the RTM moduleblocks the port to prevent traffic from flowing to or from the port,saves a runtime state of the first version of the firewall module thatrelates to the port, transfers association of a firewall filterassociated with the port from the first version of the firewall moduleto the second version of the firewall module, restores the saved runtimestate for the port to the second version of the firewall module, andthen unblocks that port.

In some embodiments, in the time period between when the firewall modulehas been upgraded for a first port and when the firewall module has beenupgraded for the last port, at least one port is serviced by the firstversion of the firewall module and at least one other port (at sometimes in the same portset) is serviced by the second version of thefirewall module. Once the firewall module has been upgraded on all ofthe ports, in some embodiments, the first version of the firewall moduleand the first version of the other SDN modules are unloaded.

FIG. 1 conceptually illustrates a process 100 of some embodiments forupgrading a set of modules (e.g., SDN modules) executing on a hostcomputer. The process 100 is performed, in some embodiments, by an RTMmodule. In some embodiments, this RTM module is loaded onto the hostcomputer to manage and coordinate the upgrade process, and unloaded oncethe upgrade process is completed.

In some embodiments, the SDN modules being upgraded can include avariety of control plane and datapath modules. FIG. 2 , for example,illustrates a set of SDN modules 200 that are upgraded during theprocess 100 described below (or a similar upgrade process), according tosome embodiments. As shown, the set of SDN modules 200 includes a coremodule 205, a traceflow module 210 (for handling flow tracing requestsfrom a network administrator), a virtual switch module 215 (for managingone or more virtual switches executing on the host), a bidirectionalforwarding detection (BFD) module 220 (for generating BFD messages tosend to other hosts and for handling BFD messages received from otherhosts), an IPFIX (Internet Protocol flow information export) module 225(for generating and exporting flow information), a virtual router module230 (for handling logical routing on the host computer), a firewallmodule 235 (for managing firewall rules for the various machines on thehost), and a filter module 240 (for handling various filters, such asfirewall filters, that handle traffic to and from ports on the host). Insome embodiments, as indicated by the ellipsis between the virtualrouter 230 and the firewall module 235, the set of SDN modules 200includes additional modules not shown. For example, some embodimentsalso include sender policy framework (SPF) modules, switch securitymodules, KCP modules, etc.

Returning to FIG. 1 , the process 100 starts, at 105, by preparing theexisting SDN modules for dual-loading of the upgraded modules.Typically, the existing SDN modules are an older version of the suite ofmodules, to be replaced by a newer version. In some embodiments, the RTMmodule prepares the existing modules by issuing cleanup events to theexisting SDN modules indicating that the dual-loading is about to beginand the existing modules should perform cleanup actions. The cleanupactions, in some embodiments, can include actions that all or most ofthe SDN modules should perform as well as actions that vary based on thedifferent types of SDN modules (e.g., a virtual switch may performdifferent actions than a BFD module). In some embodiments, the actionsrelate to closing resources that cannot be shared between the existingand upgraded modules, but that are required for functioning, in order toallow the upgraded modules to take over use of these resources withoutany conflicts once the upgraded modules are loaded.

For example, in some embodiments, one cleanup action performed by atleast a subset of the SDN modules relates to character devices that areused by the modules to write logs and communicate with the control plane(e.g., a control plane that executes in the user space of the hostcomputer virtualization software) to exchange information, and whichcannot be shared between both the old modules and the upgraded modules.When an SDN module receives the cleanup event from the RTM module, thecontrol plane/user space has already been stopped for the upgradeprocess, so the SDN module can close its respective character device inorder to allow the upgraded module to take over and use the characterdevice once the upgraded module is loaded and before the controlplane/user space is restarted and can resume communications with the SDNmodules.

Next, at 110, the process 100 loads the upgraded SDN modules onto thehost computer alongside the existing modules as the existing modulescontinue to process traffic. For example, FIG. 3 illustrates a set ofstages 300 to provide a visual representation of the dual-loading andupgrading of the SDN modules according to some embodiments. In the firststage 301, a set of upgraded (“new”) modules are shown alongside a setof existing (“old”) modules. The set of existing modules includes atleast a core module 310 a, a virtual switch module 320 a, a virtualrouter module 330 a, and a firewall module 340 a, while the set ofupgrade modules includes a core module 310 b, a virtual switch module320 b, a virtual router module 330 b, and a firewall module 340 b. Theset of existing modules in the first stage 301 appear bolded to indicatethat they are the modules that are currently processing traffic.

The process 100 then saves, at 115, global runtime states for at least aset of the existing SDN modules. In some embodiments, these modulesstore runtime state for multiple “clients”. For instance, the virtualswitch module might manage multiple software virtual switches (theclients) operating on the host to switch data messages, and store statefor each of these switches. In addition, for each client of a module,state may be stored for multiple different ports (e.g., ports to whichVMs, containers, or other machines attach). In some embodiments, theglobal runtime states include global configuration data for all portsassociated with all clients of each of at least a set of the existingmodules.

Next, the process 100 selects a portset to upgrade at 120. A portset, insome embodiments, includes a set of ports associated with a virtualswitch. In some embodiments, the RTM module upgrades the SDN modules foreach portset on a portset-by-portset basis. The RTM module may selectportsets in various different orders in different embodiments.

After selecting a portset, the RTM module, at 125, blocks all of theports on the portset to prevent traffic from flowing to or from theports. While this does result in some downtime for each port, downtimeper port is minimized by upgrading only one portset at a time. While oneportset is being switched over to the new set of modules, the otherportsets can continue sending/receiving traffic, unaffected by theupgrade.

At 130, the process 100 saves runtime states from the existing SDNmodules for the selected portset, with the exception of the runtimestate of the firewall module. As will be described below, someembodiments handle the firewall module upgrade differently because thefirewall module often stores many (e.g., hundreds, thousands) of rulesper port.

The process 100 then transfers, at 135, traffic processingresponsibilities for the selected portset from the existing SDN modulesto the upgraded SDN modules. As shown in the second stage 302 of the setof stages 300, each of the existing SDN modules 310 a-330 a are nolonger bolded, while the corresponding upgraded modules 310 b-330 b nowappear bolded to indicate that these upgraded modules are nowresponsible for traffic processing for the portset. Conversely, theexisting firewall module 340 a still appears bolded to indicate it isstill responsible for traffic processing and has not yet been upgraded.

Following (or in conjunction with) the transferring of trafficprocessing responsibilities from the existing SDN modules to theupgraded SDN modules, the process restores, at 140, the saved runtimestates for the selected portset in the upgraded SDN modules and unblocksall of the ports on the portset to allow traffic to flow again to andfrom the ports. In some embodiments, the saved global runtime states arerestored for the upgraded SDN modules at the same time that the RTMmodule transfers the traffic processing responsibilities. The runtimestate save and restoration process is also described in greater detailbelow.

The process 100 then determines, at 145, whether there are additionalportsets for which the SDN modules need to be upgraded. When the RTMmodule determines at 145 that there are additional portsets for whichthe SDN modules need to be upgraded, the process returns to step 120 toselect another portset and transfer responsibility for this next portsetto the upgraded modules.

Otherwise, when responsibility for handling traffic for all of theportsets has been switched over to the new (upgraded) modules, theprocess transitions to 150 to upgrade the firewall module on each portof each of the portsets on a port-by-port basis. As shown in the thirdstage 303 of the stages 300, all of the upgraded modules 310 b-340 b,now appear bolded as the firewall module has also been upgraded for theportsets. As mentioned, the firewall module upgrade is described furtherbelow.

Once the firewall module has been upgraded on all of the ports of all ofthe portsets at 150, the process 100 unloads the old SDN modules at 155.For example, in the fourth and final stage 304 of the stages 300, onlythe new, upgraded SDN modules 310 b-340 b remain as the old modules havenow been unloaded. After the old SDN modules have been unloaded at 155,the process 100 ends. In some embodiments, the downtime experiencedduring the process 100 for a scale of approximately 1000 VM ports on asingle hypervisor is of the order of less than 1 second.

In some embodiments, different modules store and save their runtimestates in different manners. For instance, some modules store all oftheir runtime state, and therefore can easily save this state forupgrade. On the other hand, the virtual router module of someembodiments collects state from a logical control plane executing on thehost computer (e.g., in the user space of the host computervirtualization software). The virtual router module handlesconfiguration for multiple virtual distributed routers that execute onthe host computer (e.g., to handle logical routing for different logicalnetworks), and uses a logical control plane to store state (e.g.,routing tables) for these virtual distributed routers. This logicalcontrol plane, in some embodiments, is responsible for modifying therouting tables used by the virtual distributed routers as the logicalnetworks change (e.g., as edge routers exchange routes and propagatethese routes down to the host computers).

FIG. 4 conceptually illustrates a process 400 of some embodiments forsaving state as part of the upgrading process. Specifically, thisprocess 400 is performed by a virtual router module (i.e., the existingvirtual router module) to collect its state and store this state to beused by the new virtual router module. The process 400 will be describedwith reference to FIG. 5 , which illustrates communications between avirtual router and a control plane during an upgrade according to someembodiments.

The process 400 starts, at 410, when the virtual router module receivesa trigger to start state collection. For example, in FIG. 5 the arrowwith the encircled 1 leading from the control plane 530 to the virtualrouter 510 on the host computer 505 indicates to the virtual router 510to start state collection. In some embodiments, the virtual routerreceives this trigger before the upgraded modules are loaded (i.e.,prior to step 110 of the process 100). In other embodiments, the controlplane is notified by the RTM module to send this trigger to the virtualrouter module.

After receiving the trigger, the process 400 requests, at 420, a fullsync of the state from the control plane to collect all virtual routerconfiguration information from the control plane. In some embodiments,the control plane will be stopped for upgrade purposes before theupgrade starts, and the virtual router module retrieves the state fromthe control plane prior to this taking place, so that the control planedoes not need to be involved in the state save/restore process. Forexample, the arrow with the encircled 2 from the virtual router 510 tothe control plane 530 indicates a request by the virtual router for fullsync from the control plane.

In response to the request for full sync, the process 400 receives, at430, all of the virtual router configuration information from thecontrol plane. For example, the virtual router 510 receives the virtualrouter configuration information from the control plane 530 along thearrow with the encircled 3 that leads from the control plane to thevirtual router. As noted, this runtime state can include routing tablesfor the various virtual distributed routers executing on the hostcomputer in some embodiments.

Once the virtual router has received all of the virtual routerconfiguration information from the control plane, the process 400 sets aflag, at 440, to indicate that the full sync is completed. Thisinteraction is represented by the arrow with the encircled 4 from thevirtual router 510 to the control plane 530 indicating the full sync iscompleted. After setting the flag, the process 400 ends. As a result ofthe full sync, the upgrade process is no longer dependent on the controlplane, and can proceed without having to wait on the control plane to berestarted in order to restore the states after the upgrade has beencompleted, according to some embodiments.

FIG. 6 conceptually illustrates actions of the RTM module to restore thesaved runtime states without having to rely on the control planeaccording to some embodiments. FIG. 6 illustrates a host computer 600 onwhich an RTM module 610 is loaded. The host computer 600 also includes anew (i.e., upgraded) virtual switch 620, a new BFD module 622, a newvirtual router 624, and a new firewall module 626. Additionally, asshown, all of the ports 630 (i.e., VM, VMKNIC, and pNIC ports, as wellas container ports which are not shown in this figure) on the hostcomputer 600 are currently blocked. While only four modules are shown onthe host computer 600, it should be noted that additional modules, suchas any of the other modules illustrated in FIG. 2 , may also be presenton the host computer 600. It should also be noted that, in someembodiments, only the ports of one portset are blocked at a given time.

As shown by the encircled 1 and encircled 2 alongside the arrows thatlead from the RTM module 610 to the virtual switch 620, the RTM modulerestores (1) the saved global configuration data/runtime state for allclients for all ports, and (2) the saved runtime states for all clientsfor all ports except the firewall module 626, which does not include apair of arrows from the RTM module. That is, the RTM module 610 restoresthe global and portset runtime states for each of the modules 620-624,and the firewall module, as mentioned above, is upgraded on aport-by-port basis after all of the other SDN modules have been upgradedfor all of the portsets. Once the runtime states have been restored, theRTM module unblocks the ports, as described above, and begins to upgradethe firewall module on each port on a port-by-port basis.

FIG. 7 illustrates a process 700 of some embodiments for transferringresponsibility for a particular distributed virtual switch on a hostfrom the old to new virtual switch module. In some embodiments, thisprocess 700, is part of transferring responsibility for handling datatraffic for the portset associated with the particular distributedvirtual switch. The process 700 is performed, in some embodiments, bythe RTM module. The process 700 will be described with reference to FIG.8 , which illustrates a diagram 800 representing this process.

The process 700 starts, at 710, by identifying a virtual switchassociated with the current portset being upgraded. As described above,a portset is a set of ports associated with a single virtual switch,according to some embodiments. In some embodiments, the RTM moduleperforms this process for each virtual switch when upgrading the portsetassociated with the different virtual switches.

After identifying the virtual switch, the process 700 dissociates, at720, property data for the identified virtual switch from the existingvirtual switch. In the diagram 800, for example, the RTM module clearsthe active client from the old module 810 for the portset at theencircled 1 and unregisters the registered property data from the oldvirtual switch module 810 for the portset at the encircled 2. Theproperty data, in some embodiments, includes configuration data specificto the implementation of the identified virtual switch for the selectedportset (e.g., MAC address to port mappings that enable the virtualswitch to switch data traffic to the correct port). The property dataremains unchanged during the process 700, according to some embodiments.

Next, at 730, the process 700 directly swaps the virtual switch from theold virtual switch module to the new virtual switch module, without theneed for any intermediate/stand-in switch. In the diagram 800, forexample, a hotswap is performed at the encircled 3 to swap from the oldmodule 810 to the new module 815. The virtual switch 805 in someembodiments is responsible for handling the configuration information(e.g., forwarding information) and providing that configurationinformation to the virtual switch module for each of the differentportsets. As the configuration information (i.e., property data) remainsunchanged, so does the DVS switch 805.

Following the hotswap, the process associates, at 740, the property datafor the identified virtual switch with the new virtual switch module. Inthe diagram 800, for example, the property data for the portset isregistered for the new module at the encircled 4, and the active client,which had been cleared from the old module, is set for the new module atthe encircled 5, and the hotswap is completed. As such, following 740,the process 700 ends.

As noted above, after all of the other SDN modules for all of theportsets have been upgraded, the RTM module of some embodiments thenupgrades the firewall module for each portset on a port-by-port basis.FIG. 9 conceptually illustrates a host computer 900 on which an RTMmodule 910 is loaded to upgrade the SDN modules. As illustrated, thevirtual switch 915 on the host computer 900 is labeled as being a newvirtual switch as the hotswap from the old virtual switch module (i.e.,as described by the process 700) to the new virtual switch module hasalready been performed.

The RTM module 910 upgrades the firewall module for the first port 930by clearing (i.e., removing) the firewall filter from the old firewallmodule 920 at the encircled 1, setting the firewall filter on the newfirewall module 925 at the encircled 2, and restoring the runtime statefor the new firewall module 925 at the encircled 3. The RTM modulerepeats these steps for each port of each portset, as will be describedin further detail below with reference to FIGS. 10 and 11 .

FIG. 10 conceptually illustrates a process 1000 of some embodiments forupgrading the firewall module. The process 1000, which is performed bythe RTM module in some embodiments, provides a more detailed elaborationof operation 150 in the process 100 described above. Process 1000 willbe described below with reference to FIG. 11 , which illustrates a setof stages 1101-1105 as the firewall module is upgraded according to someembodiments.

The process 1000 starts, at 1010, by selecting a port. In someembodiments, responsibility for ports are transferred over within oneportset at a time, while in other embodiments the ports are selected ina different order. That is, in some embodiments, the RTM moduletransfers responsibility for handling firewall rules for all of theports in a single portset (one port at a time) before moving onto theports of a next portset.

The process 1000 then blocks the selected port at 1020 to preventtraffic from flowing to and from the port during the transfer process.For example, in the first stage 1101 of FIG. 11 , a first VM port 1130is shown as blocked, similar to the illustration of FIG. 9 describedabove. While this does require a certain amount of downtime for eachport, this downtime is small relative to the time that would be requiredto transfer state (firewall rules) for all of the ports (or even all ofthe ports in a single portset) at once.

After blocking the selected port, the process 1000 saves, at 1030, theruntime state of the firewall module for the selected port. In someembodiments, this runtime state may include all of the currently-activefirewall rules that relate to the port (e.g., for both ingress andegress traffic). In addition, if the firewall includes stateful rules,then the runtime state may include connection state for incoming and/oroutgoing connections of the currently selected port.

Next, the process 1000 moves, at 1040, the firewall filter from the oldfirewall module to the upgraded firewall module. The firewall filter insome embodiments is a distributed virtual (DV) firewall filter thatperforms various operations such as filtering, encapsulation, anddecapsulation of data messages sent to and from the port. The filter, insome embodiments, is responsible for intercepting these data messagesand applying the correct firewall rules (e.g., as stored by the firewallmodule) to the data messages. Once the filter has been moved from theold firewall module and set on the upgraded firewall module, the RTMmodule restores, at 1050, the saved runtime state of the firewall modulefor the selected port to the upgraded firewall module.

The process 1000 then unblocks the selected port at 1060. Once the porthas been unblocked, in some embodiments, the upgraded firewall modulebegins serving the port and the old firewall module ceases to serve theport, but may continue to serve other ports for which the firewallmodule has not yet been upgraded. For example, in the second stage 1102of FIG. 11 , the port 1130 appears with a bolded outline to indicatethat it is now being served by the upgraded firewall module, while theother ports do not appear with a bolded outline indicating they arestill being served by the old firewall.

After unblocking the selected port at 1060, the process 1000 determines,at 1070, whether there are additional ports for which responsibilityneeds to be transferred to the upgraded firewall module. When additionalports remain, the process 1000 returns to 1010 to select a port. Forexample, in the second stage 1102 discussed above, the VM port 1132 isillustrated as being blocked while all other ports are unblocked,indicating the firewall module is currently being upgraded for the port1132. Once all ports have been transferred over to the upgraded firewallmodule, the process 1000 ends.

In some embodiments, from the time that responsibility for the firstport is transferred to the upgraded firewall module to the time thatresponsibility for the last port is transferred to the upgraded firewallmodule, at least one port will be served by the old firewall module andat least another port will be served by the new firewall module suchthat both versions of the firewall module are simultaneously servingports (including ports within a single portset) for a period of time. Asfurther illustrated in FIG. 11 , once a port has been upgraded, it isunblocked and subsequently served by the upgraded firewall module.

For example, in stage 3 1103, both of the VM ports 1130-1132 areillustrated with a bolded outline indicating the firewall module hasbeen upgraded for these ports and they are now being served by theupgraded firewall module. Additionally, the VMKNIC port 1134 is blockedfor upgrading of the firewall module. In stage 4 1104, the VM ports andthe VMKNIC port are all shown with a bolded outline and are being servedby the upgraded firewall module, while the firewall module is beingupgraded on the blocked container port 1136. In the fifth and finalstage 1105, all of the VM, VMKNIC, and container ports are bolded,indicating the firewall module upgrade for this portset is complete, andall of the ports are now being served by the upgraded firewall module.

Many of the above-described features and applications are implemented assoftware processes that are specified as a set of instructions recordedon a computer readable storage medium (also referred to as computerreadable medium). When these instructions are executed by one or moreprocessing unit(s) (e.g., one or more processors, cores of processors,or other processing units), they cause the processing unit(s) to performthe actions indicated in the instructions. Examples of computer readablemedia include, but are not limited to, CD-ROMs, flash drives, RAM chips,hard drives, EPROMs, etc. The computer readable media does not includecarrier waves and electronic signals passing wirelessly or over wiredconnections.

In this specification, the term “software” is meant to include firmwareresiding in read-only memory or applications stored in magnetic storage,which can be read into memory for processing by a processor. Also, insome embodiments, multiple software inventions can be implemented assub-parts of a larger program while remaining distinct softwareinventions. In some embodiments, multiple software inventions can alsobe implemented as separate programs. Finally, any combination ofseparate programs that together implement a software invention describedhere is within the scope of the invention. In some embodiments, thesoftware programs, when installed to operate on one or more electronicsystems, define one or more specific machine implementations thatexecute and perform the operations of the software programs.

FIG. 12 conceptually illustrates a computer system 1200 with which someembodiments of the invention are implemented. The computer system 1200can be used to implement any of the above-described hosts, controllers,gateway and edge forwarding elements. As such, it can be used to executeany of the above described processes. This computer system includesvarious types of non-transitory machine readable media and interfacesfor various other types of machine readable media. Computer system 1200includes a bus 1205, processing unit(s) 1210, a system memory 1225, aread-only memory 1230, a permanent storage device 1235, input devices1240, and output devices 1245.

The bus 1205 collectively represents all system, peripheral, and chipsetbuses that communicatively connect the numerous internal devices of thecomputer system 1200. For instance, the bus 1205 communicativelyconnects the processing unit(s) 1210 with the read-only memory 1230, thesystem memory 1225, and the permanent storage device 1235.

From these various memory units, the processing unit(s) 1210 retrieveinstructions to execute and data to process in order to execute theprocesses of the invention. The processing unit(s) may be a singleprocessor or a multi-core processor in different embodiments. Theread-only-memory (ROM) 1230 stores static data and instructions that areneeded by the processing unit(s) 1210 and other modules of the computersystem. The permanent storage device 1235, on the other hand, is aread-and-write memory device. This device is a non-volatile memory unitthat stores instructions and data even when the computer system 1200 isoff. Some embodiments of the invention use a mass-storage device (suchas a magnetic or optical disk and its corresponding disk drive) as thepermanent storage device 1235.

Other embodiments use a removable storage device (such as a floppy disk,flash drive, etc.) as the permanent storage device. Like the permanentstorage device 1235, the system memory 1225 is a read-and-write memorydevice. However, unlike storage device 1235, the system memory is avolatile read-and-write memory, such as random access memory. The systemmemory stores some of the instructions and data that the processor needsat runtime. In some embodiments, the invention's processes are stored inthe system memory 1225, the permanent storage device 1235, and/or theread-only memory 1230. From these various memory units, the processingunit(s) 1210 retrieve instructions to execute and data to process inorder to execute the processes of some embodiments.

The bus 1205 also connects to the input and output devices 1240 and1245. The input devices enable the user to communicate information andselect commands to the computer system. The input devices 1240 includealphanumeric keyboards and pointing devices (also called “cursor controldevices”). The output devices 1245 display images generated by thecomputer system. The output devices include printers and displaydevices, such as cathode ray tubes (CRT) or liquid crystal displays(LCD). Some embodiments include devices such as touchscreens thatfunction as both input and output devices.

Finally, as shown in FIG. 12 , bus 1205 also couples computer system1200 to a network 1265 through a network adapter (not shown). In thismanner, the computer can be a part of a network of computers (such as alocal area network (“LAN”), a wide area network (“WAN”), or anIntranet), or a network of networks (such as the Internet). Any or allcomponents of computer system 1200 may be used in conjunction with theinvention.

Some embodiments include electronic components, such as microprocessors,storage and memory that store computer program instructions in amachine-readable or computer-readable medium (alternatively referred toas computer-readable storage media, machine-readable media, ormachine-readable storage media). Some examples of such computer-readablemedia include RAM, ROM, read-only compact discs (CD-ROM), recordablecompact discs (CD-R), rewritable compact discs (CD-RW), read-onlydigital versatile discs (e.g., DVD-ROM, dual-layer DVD-ROM), a varietyof recordable/rewritable DVDs (e.g., DVD-RAM, DVD-RW, DVD+RW, etc.),flash memory (e.g., SD cards, mini-SD cards, micro-SD cards, etc.),magnetic and/or solid state hard drives, read-only and recordableBlu-Ray® discs, ultra-density optical discs, any other optical ormagnetic media, and floppy disks. The computer-readable media may storea computer program that is executable by at least one processing unitand includes sets of instructions for performing various operations.Examples of computer programs or computer code include machine code,such as is produced by a compiler, and files including higher-level codethat are executed by a computer, an electronic component, or amicroprocessor using an interpreter.

While the above discussion primarily refers to microprocessor ormulti-core processors that execute software, some embodiments areperformed by one or more integrated circuits, such as applicationspecific integrated circuits (ASICs) or field programmable gate arrays(FPGAs). In some embodiments, such integrated circuits executeinstructions that are stored on the circuit itself.

As used in this specification, the terms “computer”, “server”,“processor”, and “memory” all refer to electronic or other technologicaldevices. These terms exclude people or groups of people. For thepurposes of the specification, the terms “display” or “displaying” meandisplaying on an electronic device. As used in this specification, theterms “computer readable medium,” “computer readable media,” and“machine readable medium” are entirely restricted to tangible, physicalobjects that store information in a form that is readable by a computer.These terms exclude any wireless signals, wired download signals, andany other ephemeral or transitory signals.

While the invention has been described with reference to numerousspecific details, one of ordinary skill in the art will recognize thatthe invention can be embodied in other specific forms without departingfrom the spirit of the invention. Thus, one of ordinary skill in the artwould understand that the invention is not to be limited by theforegoing illustrative details, but rather is to be defined by theappended claims.

The invention claimed is:
 1. A method of upgrading a plurality ofsoftware defined networking (SDN) modules executing on a host computer,the method comprising: while a first version of the SDN modules isexecuting on the host computer to perform traffic processing, loading asecond version of the SDN modules alongside the first version of the SDNmodules such that the first and second versions of the SDN modules areexecuting on the host computer at the same time; saving runtime statesfrom the first version of the SDN modules; transferring responsibilityfor performing traffic processing from the first version of the SDNmodules to the second version of the SDN modules; and restoring thesaved runtime states to the second version of the SDN modules, whereinall SDN modules of the first version are identified by a first numberand all SDN modules of the second version are identified by a differentsecond number.
 2. The method of claim 1, wherein the first version ofthe SDN modules is an existing version of the plurality of SDN modulesand the second version of the SDN modules is an upgraded version of theplurality of SDN modules.
 3. The method of claim 1 further comprisingunloading the first version of the SDN modules from the host computerafter the saved runtime states have been restored in the second versionof the SDN modules.
 4. The method of claim 1, wherein the first numberis associated with a first set of namespaces defined for the pluralityof SDN modules and the different second number is associated with asecond set of namespaces defined for the plurality of SDN modules. 5.The method of claim 1, wherein: the plurality of SDN modules comprises avirtual switch module that provides configuration for a plurality ofvirtual switches on the host computer; and transferring responsibilityfor performing traffic processing from the first version of the SDNmodules to the second version of the SDN modules comprises:disassociating a set of properties associated with a particular virtualswitch from the first version of the virtual switch module; directlyswapping the particular virtual switch from the first version of thevirtual switch module to the second version of the virtual switchmodule; and associating the set of properties with the second version ofthe virtual switch module.
 6. The method of claim 1, wherein the methodis performed by a runtime migrator module that is loaded prior toloading the second version of the SDN modules and unloaded after theplurality of SDN modules are upgraded.
 7. The method of claim 1, whereinsaving runtime states from the first version of the SDN modulescomprises sending a trigger to a virtual router module executing on thehost computer to cause the virtual router module to begin statecollection.
 8. The method of claim 7, wherein, in response to receivingthe trigger, the virtual router module requests configuration data froma control plane that manages routing information for the virtual routermodule on the host computer, receives the configuration data from thecontrol plane, and sets a flag indicating that the state collection iscomplete.
 9. The method of claim 1, wherein the SDN modules comprise aplurality of datapath modules and a plurality of control plane modules.10. A method of upgrading a plurality of software defined networking(SDN) modules executing on a host computer, the plurality of SDN modulescomprising a virtual switch module that provides configuration for aplurality of virtual switches on the host computer, the methodcomprising: while a first version of the SDN modules is executing on thehost computer to perform traffic processing, loading a second version ofthe SDN modules alongside the first version of the SDN modules such thatthe first and second versions of the SDN modules are executing on thehost computer at the same time; saving runtime states from the firstversion of the SDN modules; transferring responsibility for performingtraffic processing from the first version of the SDN modules to thesecond version of the SDN modules, wherein transferring responsibilityfor performing traffic processing comprises (i) disassociating a set ofproperties associated with a particular virtual switch from the firstversion of the virtual switch module, (ii) directly swapping theparticular virtual switch from the first version of the virtual switchmodule to the second version of the virtual switch module, and (iii)associating the set of properties with the second version of the virtualswitch module; and restoring the saved runtime states to the secondversion of the SDN modules, wherein the SDN modules are updated on aportset-by-portset basis and each respective portset of a set ofportsets comprises a set of ports of a respective virtual switch of theplurality of virtual switches.
 11. The method of claim 10, whereintransferring responsibility for performing traffic processing from thefirst version of the SDN modules to the second version of the SDNmodules further comprises: transferring responsibility for performingtraffic processing for all of the portsets from the first version of theSDN modules to the second version of the SDN modules for all of themodules of the plurality of modules except for a firewall module; andseparately transferring responsibility for performing traffic processingfor the firewall module.
 12. A method of upgrading a plurality ofsoftware defined networking (SDN) modules executing on a host computer,the SDN modules comprising a plurality of datapath modules and aplurality of control plane modules, the method comprising: while a firstversion of the SDN modules is executing on the host computer to performtraffic processing, loading a second version of the SDN modulesalongside the first version of the SDN modules such that the first andsecond versions of the SDN modules are executing on the host computer atthe same time; saving runtime states from the first version of the SDNmodules; transferring responsibility for performing traffic processingfrom the first version of the SDN modules to the second version of theSDN modules; and restoring the saved runtime states to the secondversion of the SDN modules, wherein the plurality of datapath modulescomprises a virtual router module, a virtual switch module, and one ormore middlebox service modules, and wherein the plurality of controlplane modules comprises a controller module, a bidirectional forwardingdetection (BFD) module, a dynamic host configuration protocol (DHCP)module, and an encryption management module.
 13. The method of claim 12,wherein all SDN modules of the first version are identified by a firstnumber and all SDN modules of the second version are identified by adifferent second number.
 14. A non-transitory machine readable mediumstoring a program which when executed by at least one processing unitupgrades a plurality of software defined networking (SDN) modulesexecuting on a host computer, the program comprising sets ofinstructions for: while a first version of the SDN modules is executingon the host computer to perform traffic processing, loading a secondversion of the SDN modules alongside the first version of the SDNmodules such that the first and second versions of the SDN modules areexecuting on the host computer at the same time; saving runtime statesfrom the first version of the SDN modules; transferring responsibilityfor performing traffic processing from the first version of the SDNmodules to the second version of the SDN modules; and restoring thesaved runtime states to the second version of the SDN modules, whereinall SDN modules of the first version are identified by a first numberand all SDN modules of the second version are identified by a differentsecond number, and wherein the first number is associated with a firstset of namespaces defined for the plurality of SDN modules and thedifferent second number is associated with a second set of namespacesdefined for the plurality of SDN modules.
 15. The non-transitory machinereadable medium of claim 14, wherein the first version of the SDNmodules is an existing version of the plurality of SDN modules and thesecond version of the SDN modules is an upgraded version of theplurality of SDN modules.
 16. The non-transitory machine readable mediumof claim 14, wherein the program further comprises a set of instructionsfor unloading the first version of the SDN modules from the hostcomputer after the saved runtime states have been restored in the secondversion of the SDN modules.
 17. The non-transitory machine readablemedium of claim 14, wherein: the plurality of SDN modules comprises avirtual switch module that provides configuration for a plurality ofvirtual switches on the host computer; and the set of instructions fortransferring responsibility for performing traffic processing from thefirst version of the SDN modules to the second version of the SDNmodules comprises sets of instructions for: disassociating a set ofproperties associated with a particular virtual switch from the firstversion of the virtual switch module; directly swapping the particularvirtual switch from the first version of the virtual switch module tothe second version of the virtual switch module; and associating the setof properties with the second version of the virtual switch module. 18.The non-transitory machine readable medium of claim 14, wherein: the setof instructions for saving runtime states from the first version of theSDN modules comprises a set of instructions for sending a trigger to avirtual router module executing on the host computer to cause thevirtual router module to begin state collection; and in response toreceiving the trigger, the virtual router module requests configurationdata from a control plane that manages routing information for thevirtual router module on the host computer, receives the configurationdata from the control plane, and sets a flag indicating that the statecollection is complete.
 19. A non-transitory machine readable mediumstoring a program which when executed by at least one processing unitupgrades a plurality of software defined networking (SDN) modulesexecuting on a host computer, the plurality of SDN modules comprising avirtual switch module that provides configuration for a plurality ofvirtual switches on the host computer, the program comprising sets ofinstructions for: while a first version of the SDN modules is executingon the host computer to perform traffic processing, loading a secondversion of the SDN modules alongside the first version of the SDNmodules such that the first and second versions of the SDN modules areexecuting on the host computer at the same time; saving runtime statesfrom the first version of the SDN modules; transferring responsibilityfor performing traffic processing from the first version of the SDNmodules to the second version of the SDN modules, wherein the set ofinstructions for transferring responsibility for performing trafficprocessing comprises sets of instructions for (i) disassociating a setof properties associated with a particular virtual switch from the firstversion of the virtual switch module, (ii) directly swapping theparticular virtual switch from the first version of the virtual switchmodule to the second version of the virtual switch module, and (iii)associating the set of properties with the second version of the virtualswitch module; and restoring the saved runtime states to the secondversion of the SDN modules, wherein the SDN modules are updated on aportset-by-portset basis and each respective portset of a set ofportsets comprises a set of ports of a respective virtual switch of theplurality of virtual switches.
 20. The non-transitory machine readablemedium of claim 19, wherein the set of instructions for transferringresponsibility for performing traffic processing from the first versionof the SDN modules to the second version of the SDN modules furthercomprises a set of instructions for: transferring responsibility forperforming traffic processing for all of the portsets from the firstversion of the SDN modules to the second version of the SDN modules forall of the modules of the plurality of modules except for a firewallmodule; and separately transferring responsibility for performingtraffic processing for the firewall module.
 21. A non-transitory machinereadable medium storing a program which when executed by at least oneprocessing unit upgrades a plurality of software defined networking(SDN) modules executing on a host computer, the program comprising setsof instructions for: while a first version of the SDN modules isexecuting on the host computer to perform traffic processing, loading asecond version of the SDN modules alongside the first version of the SDNmodules such that the first and second versions of the SDN modules areexecuting on the host computer at the same time; saving runtime statesfrom the first version of the SDN modules; transferring responsibilityfor performing traffic processing from the first version of the SDNmodules to the second version of the SDN modules; and restoring thesaved runtime states to the second version of the SDN modules, whereinthe SDN modules comprise a plurality of datapath modules and a pluralityof control plane modules, the plurality of control plane modulescomprises a virtual router module, a virtual switch module, and one ormore middlebox service modules; and the plurality of control planemodules comprises a controller module, a bidirectional forwardingdetection (BFD) module, a dynamic host configuration protocol (DHCP)module, and an encryption management module.